<?php
    include("includes/connect_db.php");
    $id_inbox = $_POST['id_inbox'];
    $temp = $_POST['temp'];
    
    $sql_ubah_status = "update inbox set status='2' where ID = '$id_inbox'";
    $query_ubah_status = mysql_query($sql_ubah_status);
?>

<div>                      
    <ul class="breadcrumb-modal" style="background-color: #0088cc; color: #FFF; text-shadow: none; font-family: 'SEGOE UI'">
        <li id="delete-msg" style="cursor: pointer;" title="Hapus Pesan" data-placement="bottom" data-animation="true">
            <i class="icon-trash icon-white"></i> 
            Hapus
        </li>
        <li id="reply" style="cursor: pointer;" title="Balas Pesan" data-placement="bottom" data-animation="true">
            <i class="icon-share-alt flip icon-white"></i> 
            Balas
        </li>
        <li id="forward" style="cursor: pointer;" title="Teruskan Pesan" data-placement="bottom" data-animation="true">
            <i class="icon-share-alt icon-white"></i> 
            Teruskan
        </li>
        
        <?php 
            if ($temp == 0) {
            } else if ($temp == 1) {
        ?>
                <li class="add-contact" style="cursor: pointer;" title="Tambahkan Ke Kontak" data-placement="bottom" data-animation="true">
                    <i class="icon-plus icon-white"></i>
                    Tambah Kontak
                </li>
        <?php
            }
        ?>

        <li class="pull-right" id="full-conv" style="cursor: pointer;" title="Tampilkan Dalam Percakapan" data-placement="bottom" data-animation="true">
            <i class="icon-comment icon-white"></i>
            Percakapan
        </li>
    </ul>
</div>
<div style="min-height: 100px; margin: 1px 10px; padding: 5px; background-color: #F5F5F5; color: #7B7B7B; font-family:'SEGOE UI'">
    <?php 
        $sql_tampil_pesan = "select 
                                TextDecoded,
                                CONCAT( DAY(ReceivingDateTime),' ',
                                    MONTHNAME(ReceivingDateTime),' ',
                                    YEAR(ReceivingDateTime),', ',
                                    DATE_FORMAT(ReceivingDateTime,'%h:%i %p')) 
                                AS waktu from inbox where ID = '$id_inbox'";
        $query_tampil_pesan = mysql_query($sql_tampil_pesan);
        $tampil_pesan = mysql_fetch_array($query_tampil_pesan);
        echo "<p align='right' style='font-size: 10px;'>$tampil_pesan[waktu]</p>";
        echo "<p style='color: #0088cc'>$tampil_pesan[TextDecoded]</p>";
    ?>
</div>
<div style="min-height: 60px; margin: 1px 10px; padding: 5px 5px 0 5px; background-color: #F5F5F5; color: #7B7B7B; font-family:'SEGOE UI'">
    <div class="input-prepend">
        <textarea id="reply-msg" placeholder="Type to Reply ..." style="font-family:'SEGOE UI'; overflow: hidden; word-wrap: break-word; resize: none; height: 50px; width: 425px;"></textarea>
        <span id="send-msg" class="add-on" style="cursor: pointer; height: 50px; width: 50px; background-color: #0088cc;">
            <table height="100%" width="100%"><tr><td align="center" style="vertical-align: middle; font-family:'SEGOE UI'; color: #FFF;">
                Send
            </td></tr></table>
        </span>
    </div>
</div>

<script type="text/javascript">
    $(document).ready(function(){
        $('#delete-msg').tooltip();
        $('#reply').tooltip();
        $('#forward').tooltip();
        $('.add-contact').tooltip();
        $('#full-conv').tooltip();
    });
</script>